<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>付款申请单</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div>
        <form id="capPayInfo_form">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">基本信息</span>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付款代收</div>
                    <div class="field">
                        <input type="checkbox" name="isFstCol" id="isFstCol"
                               <c:if test="${capPayInfoVO.isFstCol==1}">checked</c:if>>
                        <span class="requiredSymbol">是</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付金额(元)</div>
                    <div class="field">
                        <span id="initPayAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付不含咨询费(元)</div>
                    <div class="field">
                        <span id="initFstShowAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">设备款(元)</div>
                    <div class="field">
                        <span id="pAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">所属事业部</div>
                    <div class="field">
                        <span>${capPayInfoVO.buOrgCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">项目类型</div>
                    <div class="field">
                        <span>${capPayInfoVO.prjTypCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">客户名称</div>
                    <div class="field">
                        <a style="cursor: pointer;" onclick="showCstDtl(${capPayInfoVO.cstId})" class="link">
                            <span>${capPayInfoVO.cstNm}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">融资租赁合同号</div>
                    <div class="field">
                        <a href="javascript:toPrjDetail(${capPayInfoVO.prjId})" class="link">
                            <span>${capPayInfoVO.contNo}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">支付表号</div>
                    <div class="field">
                        <a href="javascript:showPrjPrdPaySchDtl()" class="link">
                            <span>${capPayInfoVO.paySchNo}</span>
                        </a>
                        <input type="text" style="display: none;" id="paySchId" name="paySchId"
                               value="${capPayInfoVO.paySchId}">
                        <input type="text" style="display: none;" id="cstMgrOrgCd" name="cstMgrOrgCd"
                               value="${capPayInfoVO.cstMgrOrgCd}">
                        <input type="text" style="display: none;" id="buOrgCd" name="buOrgCd"
                               value="${capPayInfoVO.buOrgCd}">
                        <input type="text" style="display: none;" id="prjPrdId" name="prjPrdId"
                               value="${capPayInfoVO.prjPrdId}">
                        <input type="text" style="display: none;" id="prjId" name="prjId" value="${capPayInfoVO.prjId}">
                        <input name="payTypCd" id="payTypCd" value="${payTypCd}" type="text" style="display:none;">
                        <input name="payStsCd" id="payStsCd" value="${capPayInfoVO.payStsCd}" type="text"
                               style="display:none;">
                        <input name="prjPrdDtlId" id="prjPrdDtlId" value="${capPayInfoVO.prjPrdDtlId}" type="text"
                               style="display:none;">
                        <input name="payAmt" id="payAmt" value="${capPayInfoVO.payAmt}" type="text"
                               style="display:none;">
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">是否上牌
                    </div>
                    <div class="field">
                        <c:if test="${prdLicInfo == 1}">
                            <c:if test="${prjPrdLicInfo != null}">
                                <a href="javascript:detailBtn('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link"><span>是</span></a>
                            </c:if>
                            <c:if test="${prjPrdLicInfo == null}">
                                <a href="javascript:alert('上牌信息有误')" class="link"><span>是</span></a>
                            </c:if>
                        </c:if>
                        <c:if test="${prdLicInfo == 0}">
                            <span>否</span>
                        </c:if>
                         
                        
                           <div id ="SP">
                          <c:if test="${prjPrdLicInfo != null && ctrlKey == 2}">
                    	 <a href="javascript:detailBtn1('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link" id = "Sp1"><span>立即验证</span></a>
                    	 </c:if>
                    	
                    	 <a href="javascript:detailBtn2('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link" id = "Sp2"><span>验证通过</span></a>
                    	 
                    	 <c:if test="${PrjLicInfo == 2&& ctrlKey == 2 && showHtOpn1 == 1}">
                    	 <a href="javascript:detailBtn2('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link" id = "Sp4"><span>验证通过</span></a>
						 </c:if>
						 
						  <c:if test="${PrjLicInfo == 2 && (ctrlKey == 3 || ctrlKey == 1 )}"> 
						 <span>验证通过</span>
						  </c:if> 
                    	 <a href="javascript:detailBtn3('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link" id = "Sp3"><span>验证不通过</span></a>
                    	 
                        <c:if test="${PrjLicInfo == 0  && ctrlKey == 2 && showHtOpn1 == 1}">
                         <a href="javascript:detailBtn3('${prjPrdLicInfo.id}','${prjPrdLicInfo.dtlId}')" class="link" id = "Sp5"><span>验证不通过</span></a>
                        </c:if>
                        
                         <c:if test="${PrjLicInfo == 0 && (ctrlKey == 3 || ctrlKey == 1)}">
                        <span>验证不通过</span>
                        </c:if>
                    </div>
                   
                    </div>
                </div>
                
                 <div class="fieldBox col_33">
                	<div class="label">累计敞口</div>
                	<div class="field">
                		<span>${opens }</span>
                	</div>
                </div >
             <c:if test="${pledgeNm == '是'}">
              <div class="fieldBox col_33">
	                	<div class="label">是否需要抵押</div>
	                	<div class="field">
	                	 <c:if test="${pledgeNm == '是'}">
                			<span>${pledgeNm } </span> 
                		 </c:if>
                		 <div>
                		 <c:if test="${prjprdMtgInfo != null && ctrlKey == 2}">
                		  <a href="javascript:DYBtn1('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link" id = "Dy1"><span>立即验证</span></a>
                		  </c:if>
                		<c:if test="${prdMtgInfo == 2 && ctrlKey == 2 && showHtOpn1 == 1}">
                		  <a href="javascript:DYBtn2('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy4">验证通过(已抵押)</span></a>
                		</c:if>
                		  <a href="javascript:DYBtn2('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy2">验证通过(已抵押)</span></a>
                         <c:if test="${prdMtgInfo == 2 && ctrlKey == 2 && showHtOpn1 == 1}">
                             <a href="javascript:DYBtn4('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy6">验证通过(无法抵押)</span></a>
                         </c:if>
                         <a href="javascript:DYBtn4('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy7">验证通过(无法抵押)</span></a>
                    	<c:if test="${prdMtgInfo == 2 && (ctrlKey == 3 || ctrlKey == 1)}">
						 <span>验证通过</span>
						 </c:if>
                    	  <a href="javascript:DYBtn3('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy3">验证不通过(未抵押)</span></a>
                    	  <c:if test="${prdMtgInfo == 1 && ctrlKey == 2 && showHtOpn1 == 1}">
                    	  <a href="javascript:DYBtn3('${prjprdMtgInfo.id}','${prjprdMtgInfo.id}')" class="link"><span id="Dy5">验证不通过(未抵押)</span></a>
                    	  </c:if>
                		 <c:if test="${prdMtgInfo == 1 && (ctrlKey == 3 || ctrlKey == 1)}">
						 <span>验证不通过</span>
						 </c:if>
                		 </div>	
                	</div>
                	</div>
             </c:if>
             <c:if test="${pledgeNm == '否'}">
                <div class="fieldBox col_33" id = "DiYa">
                	<div class="label">是否需要抵押</div>
                	<div class="field">
                	 <c:if test="${pledgeNm == '否'}">
                		<span>${pledgeNm }</span>
                	 </c:if>
                    </div>
                    </div>
             </c:if>     
             <c:if test="${historyGrpBiz == '0' }">
              <c:if test="${opens < '1500000' }">
              <div class="fieldBox col_33" id="Td1">
                	<div class="label">是否团单</div>
                	<div class="field">
                		<span>否</span>
                	</div>
                </div>
             </c:if> 
              <c:if test="${opens >= '1500000' }">
                 <div class="fieldBox col_33" id="Td2">
                	<div class="label">是否团单</div>
                	<div class="field">
                		<span>是</span>
                	</div>
                </div>
                </c:if>
                <c:if test="${opens != null }">
                	<div class="fieldBox col_33" id="Td3">
                		<div class="label">是否团单</div>
                		<div class="field">
                		<select id = 'opens_select'>
                			<option value="1" >是</option>
                			<option value="0">否</option>
                		</select>
                		</div>
                	</div>
                </c:if>
                </c:if> 
                <c:if test="${historyGrpBiz== '1' && grpBiz =='1' }">
                 <div class="fieldBox col_33" id="GrpBiz_1">
		            <div class="label">是否团单</div>
		            <div class="field" >
		            	<select name="isGrp" id = 'opens_select' data-value="" validate="{required:true}" >
		                	<option value="">请选择</option>
		                	<c:forEach items="${isGrpList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
						<span class="requiredSymbol">*</span>
		            </div>
		        </div> 
                </c:if>
                <c:if  test="${historyGrpBiz== '1' && grpBiz =='0' }">
                 <div class="fieldBox col_33" id="GrpBiz_2">
		            <div class="label">是否团单</div>
		            <div class="field" >
		            	<select name="isGrp" id = 'opens_select' data-value=" "  validate="{required:false}" ligerui="{readonly:true}">
		                	<option value="">请选择</option>
		                	<c:forEach items="${isGrpList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
						<span class="requiredSymbol">*</span>
		            </div>
		        </div> 
                </c:if>
                    <div class="fieldBox col_33">
                        <div class="label">是否外部机构放款</div>
                        <div class="field">
                            <select name="isOutInsLoan" id="isOutInsLoan" data-value=" ">
                                <option value=" " selected="selected">请选择</option>
                                <c:forEach items="${yesOrNOList }" var="kv">
                                    <c:if test="${kv.key == isOutInsLoan}">
                                        <option value="${kv.key}" selected="selected">${kv.value}</option>
                                    </c:if>
                                    <c:if test="${kv.key != isOutInsLoan}">
                                        <option value="${kv.key}">${kv.value}</option>
                                    </c:if>
                                </c:forEach>
                            </select>
                            <span class="requiredSymbol">*</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33" id="loanInsCodeDiv">
                        <div class="label">放款机构名称</div>
                        <div class="field">
                            <select name="loanInsCode" id="loanInsCode" value="${loanInsCode}">
                                <c:if test="${loanInsCode == null || loanInsCode == ''}">
                                    <option value="" selected="selected">--请选择--</option>
                                </c:if>
                                <c:if test="${loanInsCode != null && loanInsCode != ''}">
                                    <option value="">--请选择--</option>
                                </c:if>
                                <c:forEach items="${friBaseList}" var="fri">
                                    <c:if test="${fri.insCode == loanInsCode}">
                                        <option value="${fri.insCode}" selected="selected">${fri.fundRasInsNm}</option>
                                    </c:if>
                                    <c:if test="${fri.insCode != loanInsCode}">
                                        <option value="${fri.insCode}">${fri.fundRasInsNm}</option>
                                    </c:if>
                                </c:forEach>
                            </select>
                            <span class="requiredSymbol">*</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33"  id="insLoanTmDiv">
                        <div class="label">机构放款时间</div>
                        <div class="field">
                            <input name="insLoanTm" id="insLoanTm" type="text" class="ui-datepicker" value="${insLoanTm}">
                            <span class="requiredSymbol">*</span>
                        </div>
                    </div>
                    <div class="fieldBox col_33" id="insLoanSumDiv">
                        <div class="label">机构放款金额</div>
                        <div class="field">
                            <input name="insLoanSum" id="insLoanSum" type="text" class="ui-textbox" value="${insLoanSum}">
                            <span class="requiredSymbol">*</span>
                        </div>
                    </div>
                <c:if test="${isNeedAddTime == '0'}">
                <div class="fieldBox col_66_auto">
                    <div class="label">实际交车时间</div>
                    <div class="field">
                        <input id="dueDt" type="text" class="ui-datepicker" name = "dueDt"
                               value="${dueDt}"
                               validate="{required:false}" ligerui="{readonly:true}">
                    </div>
                </div>
                </c:if>
                <c:if test="${isNeedAddTime == '1'}">
                    <div class="fieldBox col_66_auto">
                        <div class="label">实际交车时间</div>
                        <div class="field">
                            <input id="dueDt" type="text" name = "dueDt" class="ui-datepicker"
                               value="${dueDt}"
                               validate="{required:true}" readonly="readonly">
                        </div>
                    </div>
                </c:if>
			    <div class="fieldBox col_100" id="pledgee">
		            <div class="label">抵押权人修改</div>
		            <div class="field" >
		            	<select name="pledgeeAuthNm" id="pledgeeAuthNm" data-value="${pledgeeAuthNm }" >
		                	<c:forEach items="${pledgeeNmList }" var="kv">
		                		<c:if test="${pledgeeAuthNm == kv.key }">
								<option value="${kv.key }" selected>${kv.value }</option>
								</c:if>
								<c:if test="${pledgeeAuthNm != kv.key }">
								<option value="${kv.key }">${kv.value }</option>
								</c:if>
							</c:forEach>
						</select>
		                <span id="addpledgeeAuthNmBtn" class="sq-button sq-button-round" onclick="addpledgeeAuthNm();" class="sq-button sq-button-round">保存</span>
		       		 </div>
		         </div>
                <div class="btnsBox" style="text-align: center;" id="BC">
                 <span id="saveTD" class="sq-button sq-button-round">保存</span>
                </div>
                <%--专车事业部浦发资管优化--%>
                <c:if test="${saveOrgBizOpnCd==1 && insCode=='spdbank'}">
                    <div class="fieldBox col_50">
                        <div class="label">三方业务处理意见</div>
                        <div class="field">
                            <select name="orgBizOpnCd" id="orgBizOpnCd" data-value="${prjBscExtDTO.orgBizOpnCd }">
                                <option value=" " selected="selected">请选择</option>
                                <c:forEach items="${orgBizOpnCdList }" var="kv">
                                    <option value="${kv.key }">${kv.value }</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="fieldBox col_50">
                        <div class="label">三方审核通过时间</div>
                        <div class="field">
                            <span name="orgCreditMdfTm" id="orgCreditMdfTm"><fmt:formatDate value="${prjBscExtDTO.orgCreditMdfTm}" pattern="yyyy-MM-dd" /></span>
                        </div>
                    </div>
                    <div class="fieldset1 clearFix">
                        <div class="btnsBox" style="text-align: center;">
                            <span id="save_orgBizOpnCd" class="sq-button sq-button-round" onclick="saveOrgBizOpnCd();">保存处理意见</span>
                        </div>
                    </div>
                </c:if>
                <c:if test="${capPayInfoVO.buOrgCd == '00000001' || capPayInfoVO.buOrgCd == '00000008'}">
                    <div class="fieldBox col_100">
                        <div class="label">风控决策系统（CDS）结果</div>
                        <div class="field">
						<span name="auditInfo" id="auditInfo">
                                ${auditInfo }
                        </span>
                        </div>
                    </div>
                </c:if>
                <div class="fieldBox col_100">
                    <div class="label">客户风险标记</div>
                    <div class="field">
						<span name="rskCstSignDesc" id="rskCstSignDesc"  style="color: red">
                            ${rskCstSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">担保人风险标记</div>
                    <div class="field">
						<span name="rskGuarSignDesc" id="rskGuarSignDesc"  style="color: red">
                            ${rskGuarSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">设备风险标记</div>
                    <div class="field">
						<span name="rskProdSignDesc" id="rskProdSignDesc"  style="color: red">
                            ${rskProdSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">Vin风险标记</div>
                    <div class="field">
						<span name="rskVinSignDesc" id="rskVinSignDesc"  style="color: red">
                            ${rskVinSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">挂靠公司风险标记</div>
                    <div class="field">
						<span name="rskLnkSignDesc" id="rskLnkSignDesc"  style="color: red">
                            ${rskLnkSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">供应商风险标记</div>
                    <div class="field">
						<span name="rskSplSignDesc" id="rskSplSignDesc"  style="color: red">
                            ${rskSplSignDesc}
                        </span>
                    </div>
                </div>
                <div class="fieldBox col_100">
                    <div class="label">手机号风险标记</div>
                    <div class="field">
						<span name="rskCstMpSignDesc" id="rskCstMpSignDesc"  style="color: red">
                            ${rskCstMpSignDesc}
                        </span>
                    </div>
                </div>

                <!-- begin add 信审遗留问题 by JL 20190819 -->
				<div class="fieldBox col_100">
					<div class="label" role="textclip">信审遗留问题</div>
					<div class="field">
						<textarea id="audRemainPro" name="audRemainPro" rows="2" class="ui-textarea l-textarea" style="width:96%"></textarea>
					</div>
				</div>
				<c:if test="${mdf_AudRemainPro==1}">
					<div class="fieldset1 clearFix">
				        <div class="btnsBox" style="text-align: center;">
					        <span id="saveAudRemainPro" class="sq-button sq-button-round" onclick="saveAudRemainPro();">保存信审遗留问题</span>
					    </div>
				    </div>
		        </c:if>
                <c:if test="${guaraStatus == 2}">
                    <div class="caption">
                        <span class="title">担保人信息</span>
                    </div>
                    <div id="guarantor" class="fieldBox col_100">
                        <div class="sqPanel">
                            <div class="sqPanel_body">
                                <div id="ligergrid_guarantor" class="sq-grid"></div>
                            </div>
                        </div>
                    </div>
                </c:if>
				<!-- end add 信审遗留问题 by JL 20190819 -->

                <c:if test="${isAuditNode==1}">
                    <c:if test="${splRiskWarnCd==1}">
                        <div class="fieldBox col_33">
                            <div class="label">供应商预警状态</div>
                            <div class="field">
                                <span style='color:red'>高风险预警</span>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${lnkRiskWarnCd==1}">
                        <div class="fieldBox col_33">
                            <div class="label">挂靠公司预警状态</div>
                            <div class="field">
                                <span style='color:red'>高风险预警</span>
                            </div>
                        </div>
                    </c:if>
                </c:if>
            </div>

            <div>
                <div id="pageInTab" class="pageInTab">
                    <div tabid="payTab" title="付款通知" lselected="true">
                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">${accItem.purpCdNm}信息</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款方类型</div>
                                    <div class="field">
                                        <input name="payeeTypCd${accItem.purpCd}" id="payeeTypCd${accItem.purpCd}"
                                               data-value="${accItem.payeeTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>

                                <div class="fieldBox col_66">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input name="rcptUnt${accItem.purpCd}" id="rcptUnt${accItem.purpCd}"
                                               data-value="${accItem.rcptUnt}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">账户类型</div>
                                    <div class="field">
                                        <input name="bkAccTypCd${accItem.purpCd}" id="bkAccTypCd${accItem.purpCd}"
                                               data-value="${accItem.bkAccTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input name="payeeBkNm${accItem.purpCd}" id="payeeBkNm${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNm}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input name="payeeBkNo${accItem.purpCd}" id="payeeBkNo${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNo}" validate="{required:true,number:true}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input name="accNo${accItem.purpCd}" id="accNo${accItem.purpCd}"
                                               data-value="${accItem.accNo}" validate="{required:true,number:false}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                    <input id="payeeId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.id}">
                                    <input id="bkId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.bkId}">
                                    <input id="purpCd${accItem.purpCd}" type="text"  style="display: none;" name="purpCd${accItem.purpCd}"
                                           value="${accItem.purpCd}">
                                </div>
                            </div>
                        </c:forEach>

                        <div class="fieldset1 tabel_col clearFix">
                            <div class="fieldBox col_100">
                                <div class="label">付款备注</div>
                                <div class="field">
                                      <textarea name="payRem" id="payRem" class="ui-textarea l-textarea"
                                                value="${capPayInfoVO.payRem}"
                                                rows="2" cols="120" style="width: 97%;"
                                                validate="{required:false,maxlength:240}">${capPayInfoVO.payRem}</textarea>
                                </div>
                            </div>
                        </div>

                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">付款信息(${accItem.purpCdNm})</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">应付款金额(元)</div> <!--  ligerui="{disabled:true} -->
                                    <div class="field">
                                        <input name="payAmts${accItem.purpCd}" id="payAmts${accItem.purpCd}"
                                               class="ui-textbox" value="" type="text" data-value="${accItem.payAmts}"
                                               data-tofix="2" validate="{required:true,number:true}" ligerui="{disabled:true,readonly:true}">
                                        <input id="payAmt${accItem.purpCd}" type="text" value="${accItem.payAmt}"
                                               style="display: none;">
                                        <input id="rebateAmt${accItem.purpCd}" type="text" value="${accItem.rebateAmt}"
                                               style="display: none;">
                                    </div>
                                </div>
                                <div class="fieldBox col_66_auto">
                                    <div class="label">付款方式</div>
                                    <div class="field">
                                        <input id="payWayCd${accItem.purpCd}" data-value="${accItem.payWayCd}"
                                               validate="{required:false}" placeholder="请选择" ltype="combobox" 
                                               <c:if test="${accItem.isSended==1 }">disabled</c:if>>
                                        <c:if test="${accItem.isSended==1 }"><span class="requiredSymbol">*此付款信息已发送网银</span></c:if>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">实付金额(元)</div>
                                    <div class="field">
                                        <input id="actPayAmt${accItem.purpCd}" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${accItem.actPayAmts}"
                                               validate="{required:false,number:true}">
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">实付时间</div>
                                    <div class="field">
                                        <input id="actPayTms${accItem.purpCd}" type="text" class="ui-datepicker"
                                               value="${accItem.actPayTms}"
                                               validate="{required:false}">
                                    </div>
                                </div>
                                <c:if test="${accItem.purpCd == '5' or accItem.purpCd == '4'}">
                                    <c:if test="${isModifyAmt == '0'}">
                                        <div class="fieldBox col_33">
                                            <div class="label">真实金额(元)</div>
                                            <div class="field">
                                                <input id="realPayAmt${accItem.purpCd}" type="text" readonly=readonly class="ui-textbox" name="realPayAmt${accItem.purpCd}"
                                                       data-tofix="2" data-value="${accItem.realPayAmt == null  ? "" : accItem.realPayAmts}"
                                                       validate="{required:false,number:true}">
                                            </div>
                                        </div>
                                    </c:if>
                                    <c:if test="${isModifyAmt == '1'}">
                                        <div class="fieldBox col_33">
                                            <div class="label">真实金额(元)</div>
                                            <div class="field">
                                                <input id="realPayAmt${accItem.purpCd}" type="text" class="ui-textbox" name="realPayAmt${accItem.purpCd}"
                                                       data-tofix="2" data-value="${accItem.realPayAmt == accItem.payAmt ? "" : accItem.realPayAmts}"
                                                       validate="{required:true,number:true}">
                                            </div>
                                        </div>
                                    </c:if>
                                </c:if>

                                <c:if test="${accItem.purpCd == '1'}">
                                    <div id="payerAccNoDiv">
                                        <div class="fieldBox col_33">
                                            <div class="label">付款账户</div>
                                            <div class="field">
                                                <input id="payerAccNo" name="payerAccNo" data-value="${accItem.payerAccNo}" placeholder="--请选择--" ltype="combobox">
                                            </div>
                                        </div>
                                        <div class="fieldBox col_33">
                                            <div class="label">开户行</div>
                                            <div class="field">
                                                <input id="payerBkNm" name="payerBkNm" data-value="${accItem.payerBkNm}" placeholder="--请选择--" ltype="combobox">
                                            </div>
                                        </div>
                                    </div>
                                </c:if>
                            </div>
                        </c:forEach>
                    </div>
                    <div tabid="leaseTab" title="租赁物信息(${capPayInfoVO.prdCount})">
                        <iframe frameborder="0" id="lease" name="lease" src=""></iframe>
                    </div>
                    <div tabid="hisTab" title="历史付款记录(${capPayInfoVO.payCount})">
                        <iframe frameborder="0" id="hispay" name="hispay" src=""></iframe>
                    </div>
                    <div tabid="mateTab" title="放款资料(${capPayInfoVO.fileCount})">
                        <iframe frameborder="0" id="material" name="material" src=""></iframe>
                    </div>
                    <div tabid="insTab" title="查看保单">
                        <iframe frameborder="0" id="insDtl" name="insDtl" src=""></iframe>
                    </div>
                    <div tabid="certTab" title="合格证">
                        <iframe frameborder="0" id="certDtl" name="certDtl" src=""></iframe>
                    </div>
                    <div tabid="invoiceTab" title="发票">
                        <iframe frameborder="0" id="invoiceDtl" name="invoiceDtl" src=""></iframe>
                    </div>
                    <%--展示银行信息采集：所属机构为建行 ccbank时，
					当前合同号下其余支付表号放款状态都不是“未申请”或者“放款失败”的时候，放款申请显示银行信息采集标签页--%>
                    <c:if test="${isShowAccTab == '1'}">
                        <div tabid="AccTab" title="银行信息采集">
                            <iframe frameborder="0" id="accInsCfg" name="accInsCfg" src=""></iframe>
                        </div>
                    </c:if>
                    <c:if test="${QZTX==1}">
                    	<div tabid="startRentTab" title="起租提醒">
                        	<iframe frameborder="0" id="startRent" name="startRent" src=""></iframe>
                    	</div>
                    </c:if>
                </div>
            </div>

            <div class="btnsBox" style="text-align: center;">
                <span id="saveCapPayInfoBtn" class="sq-button sq-button-round">保存</span>
                <span id="startFlowBtn" class="sq-button sq-button-round">发起流程</span>
                <span id="backCapPayInfoBtn" class="sq-button sq-button-round">返回</span>
                <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
                <c:if test="${showRec==1}">
                    <sys:funcAuth resCd="paySendToRecorder">
                        <span id="sendToRecorderBtn" class="sq-button sq-button-round">发送至录单员</span>
                    </sys:funcAuth>
                </c:if>
                <c:if test="${taskDefKey1 == 2 }">
                	<span id="addBtn" class="sq-button sq-button-round">添加补充信息</span>
                </c:if>
                <c:if test="${taskDefKey1==3}">
                    <span id="contractOpn" class="sq-button sq-button-round"
                          onclick="contractOpnStart();">放款合同通过意见</span>
                </c:if>
                <c:if test="${showDyOpn==1}">
                    <span id="mortGageOpn" class="sq-button sq-button-round"
                          onclick="mortGageOpnStart();">放款抵押通过意见</span>
                </c:if>
                <c:if test="${showRejOpn==1}">
                    <span id="rejOpn" class="sq-button sq-button-round" onclick="rejOpnStart();">驳回意见</span>
                </c:if>
                <c:if test="${isAllowSendPay==1 }">
		        	<span id="sendPayDIV" class="sq-button sq-button-round" onclick="toSendPay();">发送付款信息到资金系统</span>
		       	</c:if>
                <c:if test="${showRejOpn == 1 }">
                    <span id="visual" class="sq-button sq-button-round" onclick="visual();" >关联图谱</span>
                </c:if>
            </div>

            <input name="cstId" id="cstId" type="text" style="display: none;" value="${capPayInfoVO.cstId}">
            <input name="splId" id="splId" type="text" style="display: none;" value="${capPayInfoVO.splId}">
        </form>
    </div>
</div>

<script>
    var pageInTab = null;
    var pageInApp = {};
    var loadedTabs = [];
    var fields = ['payeeTypCd', 'rcptUnt', 'bkAccTypCd', 'payeeBkNm', 'payeeBkNo', 'accNo', 'payeeId', 'bkId', 'purpCd', 'payAmt', 'actPayAmt', 'actPayTms', 'payWayCd','realPayAmt'];
    var form = null;
    var counts = [];
    var _id = "${id}";
    //担保人信息操作按钮展示状态
    var guaraStatus = '${guaraStatus}';
    var prjId='${capPayInfoVO.prjId}';
    if (guaraStatus==2){
        initGuarantorList();//初始化担保人列表
    }
    $(function () {
    	initPledgeeAuthNm();

    	initAudRemainPro(); //初始化"信审遗留问题字段"-JL-20190820
        var updInsLoan = '${updInsLoan}';
        var capPayInfoId = "${capPayInfoVO.id}";//主键ID
        var capPayStsCd = "${capPayInfoVO.payStsCd}";//付款状态
        var prjTypCd = "${capPayInfoVO.prjTypCd}";
        var rcptUntIsMdf = "${rcptUntIsMdf}";
        var feeAmtAndDtIsMdf = "${feeAmtAndDtIsMdf}";
        var rcptUntUnionMdf = "${rcptUntUnionMdf}";
        var feeAmtAndDtUnionMdf = "${feeAmtAndDtUnionMdf}";
        var payTypCd = "${payTypCd}";//付款类型 1:正常放款 2：提前放款
        var taskDefKey = "${taskDefKey}";//流程节点 定义  放款前是null
        var pledgeNm = "${pledgeNm}";//抵押（是，否）
        var showHtOpn = "${showHtOpn}";//提前放款第二个信审判断
        var prdMtgInfo = "${prdMtgInfo}";//1,2抵押验证信息
        var prjprdMtg = "${prjprdMtg }";//
        var prjprdMtgInfo = "${prjprdMtgInfo }";//验证信息
        var PrjLicInfo = "${PrjLicInfo}";//上牌验证信息 0，2
        var prdLicInfo = "${prdLicInfo}";//
        var prjPrdLicInfo = "${prjPrdLicInfo}";//上牌信息
        var mtgWayCd = "${mtgWayCd}";//抵押方式
        
        
        var showHtOpn1 = "${showHtOpn1}";
        var showRejOpn = "${showRejOpn}";
        var ctrlKey = '${ctrlKey}';
        var procNm = '${procNm}';//流程名称

        $("#payerAccNo").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            width:150
        });

        $("#payerBkNm").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            width:150
        });


        function initPledgeeAuthNm(){
        	//默认页面上抵押权人修改是隐藏状态
        	$("#pledgee").hide();
        	$("#addpledgeeAuthNmBtn").hide();
        	if('${authNm}'==1){
        		$("#pledgee").show();
            	$("#addpledgeeAuthNmBtn").show();
        	}
        }
         if(prjprdMtgInfo != "" && prdMtgInfo != ""){// 如果有抵押信息并且有验证信息   回显 
        	$("#Dy1").hide();
        	 if(prdMtgInfo == '2' && mtgWayCd == '2'){
        		$("#Dy4").hide();
        		$("#Dy5").hide();
        		$("#Dy3").hide();
        		$("#Dy2").hide();
        		$("#Dy6").hide();
        		$("#Dy7").show();
        	 } else if (prdMtgInfo == '2'){
                 $("#Dy4").hide();
                 $("#Dy5").hide();
                 $("#Dy2").show();
                 $("#Dy3").hide();
                 $("#Dy6").hide();
                 $("#Dy7").hide();
             } else{
        		$("#Dy4").hide();
        		$("#Dy5").hide();
        		$("#Dy2").hide();
        		$("#Dy3").show();
        		$("#Dy6").hide();
                $("#Dy7").hide();
        	}
        } 
         if(prjPrdLicInfo != null && PrjLicInfo != ""){// 如果有上牌信息并且有验证信息   回显 
        	 $("#Sp1").hide();
         if(PrjLicInfo == '2'){
        	 $("#Sp4").hide();
        	 $("#Sp5").hide();
        	 $("#Sp2").show();
        	 $("#Sp3").hide();
        	 
         }else{
        	 $("#Sp4").hide();
        	 $("#Sp5").hide();
        	 $("#Sp3").show();
        	 $("#Sp2").hide();
         }
         }
          if(taskDefKey == ""){//发起流程前
        	$("#Sp1").hide();//隐藏上牌
        	$("#Sp2").hide();
            $("#Sp3").hide();
            $("#Sp4").hide();
            $("#Sp5").hide();
            $("#Dy1").hide();//隐藏抵押
            $("#Dy2").hide();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
            $("#Td3").hide();//团单下拉框
            $("#BC").hide();//保存按钮
        }    
      /*   --------------------------------------正常放款---------------------------------------------------- */
          if(payTypCd =="1" && showHtOpn1 == "1"){//正常放款信审节点-
         	$("#Td1").hide();//团单隐藏
         	$("#Td2").hide();
         	$("#BC").show();//保存按钮显示
          	if(PrjLicInfo == 2 ){
          		$("#Sp2").show();
          		$("#Sp3").hide();
          		$("#Sp4").hide();
          		$("#Sp5").hide();
          	}else if (PrjLicInfo == 0){
          		$("#Sp3").show();
          		$("#Sp2").hide();
          		$("#Sp4").hide();
          		$("#Sp5").hide();
          	}
          	 if(prdMtgInfo == 2 && mtgWayCd == 2){
         		$("#Dy4").hide();
         		$("#Dy5").hide();
         		$("#Dy3").hide();
         		$("#Dy2").hide();
                $("#Dy6").hide();
                $("#Dy7").show();
          	 }else if(prdMtgInfo == 2){
                 $("#Dy4").hide();
                 $("#Dy5").hide();
                 $("#Dy3").hide();
                 $("#Dy2").show();
                 $("#Dy6").hide();
                 $("#Dy7").hide();
             }else if(prdMtgInfo ==1){
         		$("#Dy4").hide();
         		$("#Dy5").hide();
         		$("#Dy2").hide();
         		$("#Dy3").show();
                $("#Dy6").hide();
                $("#Dy7").hide();
         	}
          	 if(prdMtgInfo == ""){
            	
                 $("#Dy2").hide();//抵押通过隐藏
                 $("#Dy3").hide();//抵押不通过隐藏
                 $("#Dy7").hide();
          	 }
          if(PrjLicInfo == ""){
        	  $("#Sp2").hide();//上牌验证通过隐藏
              $("#Sp3").hide();//上牌验证不通过隐藏
           }
         } 
        //正常放款信审-如果是否需要抵押是否 则不显示立即验证
         if(pledgeNm == '否'){
             $("#Dy1").hide();
         	 $("#Dy2").hide();
             $("#Dy3").hide();
             $("#Dy7").hide();
         }
        if(payTypCd =="1" && taskDefKey =="FLOW_00000008_002_002_029"){//正常，商务
        	 $("#Sp1").hide();
        	 $("#Sp2").hide();//上牌验证通过隐藏
             $("#Sp3").hide();//上牌验证不通过隐藏
             $("#Sp4").hide();//上牌验证不通过隐藏
             $("#Sp5").hide();//上牌验证不通过隐藏
             $("#Dy1").hide();
             $("#Dy2").hide();//抵押通过隐藏
             $("#Dy3").hide();//抵押不通过隐藏
             $("#Dy4").hide();//抵押不通过隐藏
             $("#Dy5").hide();//抵押不通过隐藏
             $("#Dy6").hide();
             $("#Dy7").hide();
             $("#Td3").hide();//团单下拉框
             $("#BC").hide();//保存按钮
             $("#Td1").show();//团单
          	 $("#Td2").show(); 
        }
        //保存团单
        $("#saveTD").click(function(){
        	var TD = $("#opens_select").find("option:selected").val();//获取下拉框的val()
        	 opt('<%=path%>/capital/capPayInfo/modifyBySpecialCar.do?id=' + capPayInfoId+'&isModifyAmt='+isModifyAmt+'&isNeedAddTime='+isNeedAddTime+'&TD='+TD, 1);
        });
       
        var opens = "${opens}";//根据敞口值判断是否团单
        if(opens == null){
        	$("#BC").hide();//保存按钮
        }
 		 if(opens >=1500000){
 		 $("#opens_select").val("1");
 		 }else if(opens < 1500000){
 		 $("#opens_select").val("0");
 	 	 }
        if(ctrlKey != null){//信审之后团单回显
        	var isGrpBiz = "${prjBscInfoVO.isGrpBiz}";
        	if(isGrpBiz =="1"){
          		 $("#opens_select").val("1");
          		 }else if(isGrpBiz =="0"){
          		 $("#opens_select").val("0");
          	 	 }else if(isGrpBiz == '2'){
          	 		 $("#opens_select").val("2");
          	 	 }else{
          	 		$("#opens_select").val("3"); 
          	 	 }
        	$("#Td1").hide();
        	$("#Td2").hide();
        	$("#Td3").show(); 
        }
        
       
        
    /*     ------------------------提前放款-------------------------------------------------------------- */
   		  if(payTypCd =="2" && showHtOpn1 == "1"){//提前放款 -第一个信审节点
        	 $("#Sp1").hide();
        	 $("#Sp2").hide();//上牌验证通过隐藏
             $("#Sp3").hide();//上牌验证不通过隐藏
             $("#Sp4").hide();//上牌验证不通过隐藏
             $("#Sp5").hide();//上牌验证不通过隐藏
             $("#Dy1").hide();
             $("#Dy2").hide();//抵押通过隐藏
             $("#Dy3").hide();//抵押不通过隐藏
             $("#Dy4").hide();//抵押不通过隐藏
             $("#Dy5").hide();//抵押不通过隐藏
             $("#Dy6").hide();
             $("#Dy7").hide();
             $("#Td3").show();//团单下拉框
             $("#BC").show();//保存按钮
             $("#Td1").hide();//团单
          	 $("#Td2").hide(); 
          
         } 
   		
        if(payTypCd =="2" && showHtOpn =="0" && showRejOpn==1){//提前放款 -第二个信审节点,信审抵押
    
       	$("#Td1").hide();//团单隐藏
      	$("#Td2").hide();
      	$("#Td3").hide();
      	$("#BC").hide();//保存按钮
      	if(PrjLicInfo == 2){
      		$("#Sp2").show();
      		$("#Sp3").hide();
      		$("#Sp4").hide();
      		$("#Sp5").hide();
      	}else{
      		$("#Sp3").show();
      		$("#Sp2").hide();
      		$("#Sp4").hide();
      		$("#Sp5").hide();
      	}
      	 if(prdMtgInfo == 2 && mtgWayCd == 2){
     		$("#Dy4").hide();
     		$("#Dy5").hide();
     		$("#Dy3").hide();
     		$("#Dy2").hide();
            $("#Dy6").hide();
            $("#Dy7").show();
     	}else if(prdMtgInfo == 2){
             $("#Dy4").hide();
             $("#Dy5").hide();
             $("#Dy3").hide();
             $("#Dy2").show();
             $("#Dy6").hide();
             $("#Dy7").hide();
        }else{
     		$("#Dy4").hide();
     		$("#Dy5").hide();
     		$("#Dy2").hide();
     		$("#Dy3").show();
            $("#Dy6").hide();
            $("#Dy7").hide();
     	}
       
       } 
        if(PrjLicInfo == ""){//没有验证信息
        	$("#Sp3").hide();
      		$("#Sp2").hide();
      		$("#Sp4").hide();
      		$("#Sp5").hide();
        }
        if(prdMtgInfo == ""){
        	$("#Dy4").hide();
     		$("#Dy5").hide();
     		$("#Dy2").hide();
     		$("#Dy3").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
        }
        if(payTypCd =="2" && taskDefKey == "FLOW_00000008_007_002_031"){//商务审核
        	 $("#Sp1").hide();
        	 $("#Sp2").hide();//上牌验证通过隐藏
             $("#Sp3").hide();//上牌验证不通过隐藏
             $("#Sp4").hide();//上牌验证不通过隐藏
             $("#Sp5").hide();//上牌验证不通过隐藏
             $("#Dy1").hide();
             $("#Dy2").hide();//抵押通过隐藏
             $("#Dy3").hide();//抵押不通过隐藏
             $("#Dy4").hide();//抵押不通过隐藏
             $("#Dy5").hide();//抵押不通过隐藏
             $("#Dy6").hide();
             $("#Dy7").hide();
             $("#Td3").hide();//团单下拉框
             $("#BC").hide();//保存按钮
             $("#Td1").hide();//团单
          	 $("#Td2").hide(); 
          	
        }
        
        if(ctrlKey == "1" && PrjLicInfo != null){//客户经理并且上牌验证必须通过
        	$("#Sp2").hide();//上牌验证通过
        	$("#Sp3").hide();//上牌验证不通过隐藏
        	$("#BC").hide();//保存按钮隐藏
        	$("#Td3").hide();//团单下拉框
        	$("#Dy2").hide();//抵押通过隐藏
            $("#Dy3").hide();//抵押不通过隐藏
            $("#Dy4").hide();//回显抵押隐藏
            $("#Dy5").hide();//回显抵押隐藏
            $("#Dy6").hide();
            $("#Dy7").hide();

        }
       if(ctrlKey == "1" && PrjLicInfo != null && prdMtgInfo != null){
    	   $("#Sp2").hide();//上牌验证通过
       	   $("#Sp3").hide();//上牌验证不通过隐藏
       	   $("#BC").hide();//保存按钮隐藏
       	   $("#Td3").hide();//团单下拉框
       	   $("#Dy2").hide();//抵押通过隐藏
           $("#Dy3").hide();//抵押不通过隐藏
           $("#Dy7").hide();

       }
       if(ctrlKey == "1" && PrjLicInfo == null && prdMtgInfo == null){
    	   $("#Sp1").hide();//隐藏上牌
           $("#Sp2").hide();
           $("#Sp3").hide();
           $("#Sp4").hide();
           $("#Sp5").hide();
           $("#Dy1").hide();//隐藏抵押
           $("#Dy2").hide();
           $("#Dy3").hide();
           $("#Dy4").hide();
           $("#Dy5").hide();
           $("#Dy6").hide();
           $("#Dy7").hide();
           $("#Td3").hide();//团单下拉框
           $("#BC").hide();//保存按钮
       }
       if(PrjLicInfo == null && prdMtgInfo == null && ctrlKey == "3"){
    	   $("#Sp1").hide();//隐藏上牌
           $("#Sp2").hide();
           $("#Sp3").hide();
           $("#Sp4").hide();
           $("#Sp5").hide();
           $("#Dy1").hide();//隐藏抵押
           $("#Dy2").hide();
           $("#Dy3").hide();
           $("#Dy4").hide();
           $("#Dy5").hide();
           $("#Dy6").hide();
           $("#Dy7").hide();
           $("#Td3").hide();//团单下拉框
           $("#BC").hide();//保存按钮
       }
       if(ctrlKey == "3" && PrjLicInfo != null && prdMtgInfo != null){
    	   $("#Sp2").hide();//上牌验证通过
       	   $("#Sp3").hide();//上牌验证不通过隐藏
       	   $("#BC").hide();//保存按钮隐藏
       	   $("#Td3").hide();//团单下拉框
       	   $("#Dy2").hide();//抵押通过隐藏
           $("#Dy3").hide();//抵押不通过隐藏
           $("#Dy7").hide();

       }
       
       var s= "${prjBscInfoVO.isGrpBiz}";
       if(s != null){
    	   $("#Td3").show();
       }
      /*  if(payTypCd =="2" && taskDefKey == "FLOW_00000008_007_002_031"){
    	 //  $("#Td3").hide();
    	   $("#Td1").show();//团单
           $("#Td2").show(); 
       } */
        var isAllowPay = "${isAllowPay}";
        if (capPayStsCd && capPayStsCd != "1" && capPayStsCd != "4") {
            $("#startFlowBtn").hide();
        }
        if (isAllowPay === '0'){
            $("#startFlowBtn").hide();
        }
        var pamt = parseInt('${capPayInfoVO.prdAmt}');//设备款
        var initamt = parseInt('${capPayInfoVO.initPayAmt}');//首期款
        var minusamt = parseInt('${capPayInfoVO.minusAmt}');//首期款不含咨询费

        $("#pAmt").text(FormatMoney(pamt / 100));
        $("#initPayAmt").text(FormatMoney(initamt / 100));
        $("#initFstShowAmt").text(FormatMoney((initamt - minusamt) / 100));

        $('#isFstCol').ligerCheckBox();

        <c:if test="${not empty accSize}">
        counts = ${accSize};
        </c:if>
        for (var i = 0; i < counts.length; i++) {
            $('#payeeTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $('#bkAccTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $("#payWayCd" + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
        }

        form = $("#capPayInfo_form").ligerForm({
            validate: true
        });

        var accCtrl = '${accCtrl}';//收款账号控制
        if (accCtrl === "1") {//不可编辑
            $("#payRem").setDisabled_ligerTextarea(true);
        }
        var entrance = '${entrance}';//付款信息控制
        //专车正常信审节点应付款金额的修改  
        if(payTypCd =="1" && showHtOpn1 == "1" && ctrlKey == "2" && taskDefKey !="FLOW_00000008_002_002_029"){//正常放款信审
        	 entrance = '2';
        }
        //专车提前信审节点应付款金额的修改 
        if(payTypCd == "2" && showHtOpn1 =="1" && showRejOpn=="1" && ctrlKey=="2" && taskDefKey != "FLOW_00000008_007_002_031"){
        	entrance = '2';
        }
        console.log("测试："+entrance);

        var payerBkNmMap = new HashMap();
        liger.get("isOutInsLoan").setDisabled(true);
        $("#payerAccNoDiv").hide();
        var _loanInsCode = $('#loanInsCode').val();
        if (null != _loanInsCode && "" != _loanInsCode) {
            setPayerAccNoData(_loanInsCode,payerBkNmMap);
        } else {
            if (liger.get("payerAccNo")){
                liger.get("payerAccNo").setValue(null);
            }
            if (liger.get("payerBkNm")){
                liger.get("payerBkNm").setValue(null);
            }
        }
        if (_loanInsCode === 'pafsbank'){
            $("#insLoanTmDiv").hide();
            $("#insLoanSumDiv").hide();
            $("#payerAccNoDiv").show();
            if (liger.get("payerAccNo")){
                liger.get("payerAccNo").setDisabled(true);
            }
            if (liger.get("payerBkNm")){
                liger.get("payerBkNm").setDisabled(true);
            }
        }
        if (updInsLoan === '2'){
            liger.get("loanInsCode").setEnabled();
        } else if (updInsLoan === '1'){
            liger.get("loanInsCode").setDisabled(true);
            if (_loanInsCode === 'pafsbank'){
                if (liger.get("payerAccNo")){
                    liger.get("payerAccNo").setEnabled();
                }
            }
        } else {
            liger.get("loanInsCode").setDisabled(true);
            if (liger.get("insLoanTm")){
                liger.get("insLoanTm").setDisabled(true);
            }
            if (liger.get("insLoanSum")){
                liger.get("insLoanSum").setDisabled(true);
            }
        }

        $("#loanInsCode").change(function (){
            var _loanInsCode = $(this).val();
            var friBaseMap = '${friBaseMap}';
            if (_loanInsCode === 'pafsbank') {
                $("#insLoanTmDiv").hide();
                $("#insLoanSumDiv").hide();
                $("#payerAccNoDiv").show();
                liger.get("payerAccNo").setDisabled(true);
                liger.get("payerBkNm").setDisabled(true);

                for (var j = 0; j < counts.length; j++) {
                    var selectid= $("#payWayCd" + counts[j]).ligerGetComboBoxManager();
                    $("#payWayCd" + counts[j]).val("3");
                    selectid.setValue("3");
                    selectid.setText("外付网银");
                    liger.get("payWayCd" + counts[j]).setDisabled(true);
                }
            } else {
                for (var j = 0; j < counts.length; j++) {
                    var selectid= $("#payWayCd" + counts[j]).ligerGetComboBoxManager();
                    $("#payWayCd" + counts[j]).val("7");
                    selectid.setValue("7");
                    selectid.setText("其他");
                    liger.get("payWayCd" + counts[j]).setDisabled(true);
                }
            }
            if(friBaseMap.length>0){
                friBaseMap = JSON.parse(friBaseMap);
                for(var key in friBaseMap) {
                    if(key === _loanInsCode){
                        var selectid= $("#isOutInsLoan").ligerGetComboBoxManager();
                        $("#isOutInsLoan").val(friBaseMap[key]);
                        selectid.setValue(friBaseMap[key]);
                    }
                }
            }
        });

        $("#payerAccNo").change(function (){
            var _payerAccNo = $(this).val();
            if(payerBkNmMap.size()>0){
                if (payerBkNmMap.containsKey(_payerAccNo)){
                    var selectid= $("#payerBkNm").ligerGetComboBoxManager();
                    $("#payerBkNm").val(payerBkNmMap.get(_payerAccNo));
                    selectid.setValue(payerBkNmMap.get(_payerAccNo));
                    selectid.setText(payerBkNmMap.get(_payerAccNo));
                }
            }
        });
        for (var j = 0; j < counts.length; j++) {
            liger.get("payeeTypCd" + counts[j]).setData(${payeeTypCdList});
            liger.get("bkAccTypCd" + counts[j]).setData(${bkAccTypCdList});
            liger.get("payWayCd" + counts[j]).setData(${payWayCdList});
            if (accCtrl === "1") {//不可编辑
                liger.get("payeeTypCd" + counts[j]).setDisabled(true);
                liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                liger.get("rcptUnt" + counts[j]).setDisabled(true);
                liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                liger.get("accNo" + counts[j]).setDisabled(true);
            } else {
                var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                if (payeeTypCd && payeeTypCd != 3) {
                    liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                    liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                    liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                    liger.get("accNo" + counts[j]).setDisabled(true);
                    // 2017-6-26 15:33:05 jiangzg modify
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        liger.get("payeeTypCd" + counts[j]).setDisabled(true);
                        liger.get("rcptUnt" + counts[j]).setDisabled(true);
                    }
                }
            }
            var purpCdNum = document.getElementById("purpCd"+counts[j]).value;
            if("all" == rcptUntIsMdf){
                liger.get("payeeTypCd"+counts[j]).setEnabled();
                liger.get("rcptUnt"+counts[j]).setEnabled();
            }else if(purpCdNum == rcptUntIsMdf){
                liger.get("payeeTypCd"+counts[j]).setEnabled();
                liger.get("rcptUnt"+counts[j]).setEnabled();
            }
            if("all" == rcptUntUnionMdf){
                liger.get("payeeTypCd"+counts[j]).setEnabled();
                liger.get("rcptUnt"+counts[j]).setEnabled();
            }else if(rcptUntUnionMdf.indexOf(purpCdNum) != -1){
                liger.get("payeeTypCd"+counts[j]).setEnabled();
                liger.get("rcptUnt"+counts[j]).setEnabled();
            }

            liger.get("actPayAmt" + counts[j]).setDisabled(true);
            liger.get("actPayTms" + counts[j]).setDisabled(true);
            liger.get("payWayCd" + counts[j]).setDisabled(true);
            liger.get("payAmts" + counts[j]).setDisabled(true);
            if (updInsLoan == '1'){
                liger.get("actPayAmt" + counts[j]).setEnabled();
                liger.get("actPayTms" + counts[j]).setEnabled();
                if (document.getElementById("loanInsCode").value == 'pafsbank'){
                    liger.get("actPayAmt" + counts[j]).setDisabled(true);
                    liger.get("actPayTms" + counts[j]).setDisabled(true);
                }
            }
            if (entrance === '1') {
                liger.get("actPayAmt" + counts[j]).setEnabled();
                liger.get("actPayTms" + counts[j]).setEnabled();
                liger.get("payWayCd" + counts[j]).setEnabled();
            } else if (entrance === '2') {//只编辑收款方应付金额
                liger.get("payAmts1").setEnabled();
                $("#payAmts1").change(function () {
                    $(document).trigger('click');
                    var amts = $("#payAmts1").val();
                    amts = amts.replace(",", "");
                    $("#payAmt1").val(amts * 100);
                    $("#payAmt").val(amts * 100);
                });
            } else if (entrance === '3') {//只能编辑供应商返利金额
                var payAmts2 = liger.get("payAmts2");
                if (payAmts2) {
                    payAmts2.setEnabled();
                    $("#payAmts2").change(function () {
                        $(document).trigger('click');
                        var amts = $("#payAmts2").val();
                        amts = amts.replace(",", "");
                        amts = amts * 100;
                        var rebateAmt = $("#rebateAmt2").val();
                        if (amts > rebateAmt) {//编辑的金额不能大于支付表明细供应商返利金额
                            $.ligerDialog.SQalert({
                                content: "供应商返利金额不能大于" + FormatMoney(rebateAmt / 100) + "元",
                                SQ_type: "warning"
                            });
                            var payAmt2 = $("#payAmt2").val();
                            $("#payAmts2").val(FormatMoney(payAmt2 / 100));
                            return;
                        }
                        $("#payAmt2").val(amts);
                    });
                }
            }

            if("all" == feeAmtAndDtIsMdf){
                liger.get("actPayTms"+counts[j]).setEnabled();
                liger.get("actPayAmt"+counts[j]).setEnabled();
            }else if(purpCdNum == feeAmtAndDtIsMdf){
                liger.get("actPayTms"+counts[j]).setEnabled();
                liger.get("actPayAmt"+counts[j]).setEnabled();
            }
            if("all" == feeAmtAndDtUnionMdf){
                liger.get("actPayTms"+counts[j]).setEnabled();
                liger.get("actPayAmt"+counts[j]).setEnabled();
            }else if(feeAmtAndDtUnionMdf.indexOf(purpCdNum) != -1){
                liger.get("actPayTms"+counts[j]).setEnabled();
                liger.get("actPayAmt"+counts[j]).setEnabled();
            }

            (function (j) {
                $("#payeeTypCd" + counts[j]).change(function () {
                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        return;
                    }
                    $("#rcptUnt" + counts[j]).val("");
                    $("#bkAccTypCd" + counts[j]).val("");
                    $("#payeeBkNm" + counts[j]).val("");
                    $("#payeeBkNo" + counts[j]).val("");
                    $("#accNo" + counts[j]).val("");
                    if (payeeTypCd == 3) {
                        liger.get("bkAccTypCd" + counts[j]).setEnabled();
                        liger.get("payeeBkNm" + counts[j]).setEnabled();
                        liger.get("payeeBkNo" + counts[j]).setEnabled();
                        liger.get("accNo" + counts[j]).setEnabled();
                    } else {
                        liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
                        liger.get("payeeBkNm" + counts[j]).setDisabled(true);
                        liger.get("payeeBkNo" + counts[j]).setDisabled(true);
                        liger.get("accNo" + counts[j]).setDisabled(true);
                    }

                });

                //选择
                $("#rcptUnt" + counts[j]).click(function (event) {
                    if("all" == rcptUntIsMdf || rcptUntUnionMdf == "all"){

                    }else if(counts[j] != rcptUntIsMdf && rcptUntUnionMdf.indexOf(counts[j]) == -1){
                        return ;
                    }
                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
                    if (!payeeTypCd) {
                        $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
                        return;
                    }
                    if (payeeTypCd == 3) {
                        return;
                    }
                    if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                        return;
                    }
                    var cstId = $("#cstId").val();//客户ID
                    var splId = $("#splId").val();//供应商ID
                    var onOk = function (item, Dialog) {
                        //在子页面里绑定 frameElement.dialog.onOk = function () {}
                        if (Dialog.onOk) Dialog.onOk();
                    };
                    var onCancel = function (item, Dialog) {
                        //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                        if (Dialog.onCancel) Dialog.onCancel();
                    };
                    $.ligerDialog.SQopen({
                        width: 850,
                        height: 350,
                        title: '收款账户列表',
                        url: '<%=path%>/capital/capPayeeInfo/toChoosePayee.do',
                        buttons: [
                            {
                                text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
                            }, {
                                text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                            }
                        ],
                        data: {payeeTypCd: payeeTypCd, cstId: cstId, splId: splId, purpCd: counts[j]}
                    });
                });
            })(j);
        }

        /*是否代收首期款*/
        $("#isFstCol").change(function () {
            if (this.checked) {
                $("#payAmts1").val(FormatMoney((pamt - initamt) / 100));//应付款=设备款-首期款
                $("#payAmt1").val(pamt - initamt);
                $("#payAmt").val(pamt - initamt);
            } else {
                $("#payAmts1").val(FormatMoney(pamt / 100));//应付款=设备款
                $("#payAmt1").val(pamt);
                $("#payAmt").val(pamt);
            }
        });

        var ctrlKey = '${ctrlKey}';//上传控制
        var buOrg = "${capPayInfoVO.buOrgCd}";
        //alert("buorg"+buOrg)
        pageInTab = $("#pageInTab").ligerTab({
            height: 'auto',
            contextmenu: false,
            minIframeHeight: GET_minIframeHeight(),
            onAfterSelectTabItem: function (tabid) {
                if (loadedTabs.indexOf(tabid) < 0) {
                    loadedTabs.push(tabid);
                    if (tabid != "payTab") {
                        switch (tabid) {
                            case "leaseTab":
                                if (ctrlKey === '3') {
                                    pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toLeaseListPage.do?paySchId=${capPayInfoVO.paySchId}&taskDefKey=${taskDefKey}&isAuditNode=${isAuditNode}&isAllowPay=" +isAllowPay);
                                } else {
                                    pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toCompPrdInfoListPage.do?dtlId=${capPayInfoVO.prjPrdDtlId}&isAuditNode=${isAuditNode}");
                                }
                                break;
                            case "hisTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toHisPayListPage.do?id=${capPayInfoVO.id}&paySchId=${capPayInfoVO.paySchId}");
                                break;
                            case "mateTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toMateListPage.do?id=${capPayInfoVO.id}&payStsCd=${capPayInfoVO.payStsCd}&ctrlKey=${ctrlKey}" +
                                        "&prjPrdDtlId=${capPayInfoVO.prjPrdDtlId}&cstId=${capPayInfoVO.cstId}&prjId=${capPayInfoVO.prjId}&cstMgrOrgCd=${capPayInfoVO.cstMgrOrgCd}&prjTypCd=${capPayInfoVO.prjTypCd}&paySchNo=${capPayInfoVO.paySchNo}");
                                break;
                            case "insTab":
                                var operateInsPlc = '${operateInsPlc}';
                            	if(operateInsPlc==1){
	                                pageInTab.setTabItemSrc(tabid, "<%=path%>/insurance/insPlcBscInfo/toPlcPage.do?paySchId=${capPayInfoVO.paySchId}&operateInsPlc=${operateInsPlc}");
   			                   	}else{
                                	pageInTab.setTabItemSrc(tabid, "<%=path%>/insurance/insPlcBscInfo/toPlcListPage.do?paySchId=${capPayInfoVO.paySchId}");
   			                   	}
                                break;
                            case "certTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toPrjPrdVehInfoListInFlow.do?isGpsNode=${isGpsNode}&paySchNo=${capPayInfoVO.paySchNo}&isAuditNode=${isAuditNode}&isAllowPay="+isAllowPay);
                                break;
                            case "invoiceTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjPrdInvoice/toflowListPage.do?paySchNo=${capPayInfoVO.paySchNo}&isAllowPay="+isAllowPay);
                                break;
                            case "startRentTab":
                            	pageInTab.setTabItemSrc(tabid, "<%=path%>/risk/rskCommRec/toStartRentPage.do?cstId=${capPayInfoVO.cstId}&paySchId=${capPayInfoVO.paySchId}");
                                break;
                            case "AccTab":
                                var isShowSaveBtn = "1";
                                if (capPayStsCd && capPayStsCd != "1" && capPayStsCd != "4") {
                                    isShowSaveBtn = "0";
                                }
                                if (isAllowPay == '0'){
                                    isShowSaveBtn = "0";
                                }
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capPay/flow/toAccInsCfgPage.do?prjId=${capPayInfoVO.prjId}&&isShowSaveBtn=" + isShowSaveBtn);
                                break;
                        }
                    }
                }
                SetIframe_height();
            }
        });

        $.extend(true, pageInApp, {
            pageInTab: pageInTab
        });

        $("#pageloading").hide();
        var isModifyAmt = ${isModifyAmt};
        var isNeedAddTime = ${isNeedAddTime};
        $("#backCapPayInfoBtn").hide();
        if(updInsLoan == '1' || updInsLoan == '2' || isModifyAmt == '1' || isNeedAddTime =='1' || ctrlKey =="1" || rcptUntIsMdf != "0" || feeAmtAndDtIsMdf != "0" || rcptUntUnionMdf != '0' || feeAmtAndDtUnionMdf !='0'){

        }else{
            $("#saveCapPayInfoBtn").hide();
        }

      //专车正常信审节点应付款金额的修改
        if(payTypCd =="1" && showHtOpn1 == "1" && ctrlKey == 2 && taskDefKey !="FLOW_00000008_002_002_029"){//正常放款信审
        	$("#saveCapPayInfoBtn").show();
        }
        //专车提前信审节点应付款金额的修改 
        if(payTypCd == "2" && showHtOpn1 =="1" && showRejOpn=="1" && ctrlKey=="2" && taskDefKey != "FLOW_00000008_007_002_031"){
        	$("#saveCapPayInfoBtn").show();
        }
        var buOrgcd = "${capPayInfoVO.buOrgCd}";
        var payeeId1 = $("#payeeId1").val();
        var isModifyAmt = "${isModifyAmt}";
        var isNeedAddTime = "${isNeedAddTime}";
        if(buOrgcd==="00000005"&&StringUtils.isNotEmpty(payeeId1)){
            //汽车金融不允许修改收款账户
            liger.get("payeeTypCd1").setDisabled(true);
            liger.get("rcptUnt1").setDisabled(true);
            $('#rcptUnt1').unbind("click"); //移除click
        }

        /*保存*/
        $("#saveCapPayInfoBtn").click(function (event) {
            var form = liger.get("capPayInfo_form");
            if (updInsLoan == '2' || updInsLoan == '1'){
                if (!form.valid()) {
                    top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                    return false; //验证不通过，不执行以下代码
                }
            }
            var isOutInsLoan = $("#isOutInsLoan").val();
            var insLoanTm = $("#insLoanTm").val();
            var insLoanSum = $("#insLoanSum").val();
            var loanInsCode = liger.get("loanInsCode").selectedValue;
            var loanInsNm = liger.get("loanInsCode").selectedText;
            var payerAccNo = '';
            if (liger.get("payerAccNo")){
                payerAccNo = liger.get("payerAccNo").selectedText;
            }
            var payerBkNm = '';
            if (liger.get("payerBkNm")){
                payerBkNm = liger.get("payerBkNm").selectedText;
            }
            //$(document).trigger('click')
            opt('<%=path%>/capital/capPayInfo/modifyBySpecialCar.do?id=' + capPayInfoId+'&isModifyAmt='+isModifyAmt+
                '&isNeedAddTime='+isNeedAddTime+'&loanInsCode='+loanInsCode+'&isOutInsLoan='+isOutInsLoan+'&insLoanTm='+insLoanTm+
                '&insLoanSum='+insLoanSum+'&loanInsNm='+loanInsNm+'&updInsLoan='+updInsLoan+'&payerAccNo='+payerAccNo+'&payerBkNm='+payerBkNm, 1);
        });

        /*返回*/
        $("#backCapPayInfoBtn").click(function (event) {
            Remove_navTab();
        });

        /*发送至录单员*/
        $("#sendToRecorderBtn").click(function (event) {
            $.ligerDialog.confirm('确定发送至录单员吗？', function (flag) {
                if (flag == false) {
                    return;
                }
                //付款类型: 正常放款,提前付款,特殊放款
                var payTypCd = $('#payTypCd').val();
                if (!payTypCd) {
                    top.$.ligerDialog.SQalert({content: "付款类型不能为空，发送失败！", SQ_type: "error"});
                    return false;
                }
                //台账类型
                var bookTypeCd = "7";
                var wait_dialog;
                $.ajax({
                    type: 'post',
                    dataType: 'json',
                    data: {
                        payId: '${capPayInfoVO.id}',
                        prjId: '${capPayInfoVO.prjId}',
                        payTypCd: payTypCd,
                        bookTypeCd: bookTypeCd
                    },
                    url: '<%=path%>/audit/audStandingBook/sendToRecoder.do',
                    beforeSend: function () {
                        wait_dialog = $.ligerDialog.SQalert({
                            content: LogUtils.LOG_CMM_DATA_LOADING,
                            SQ_type: "waitting"
                        });
                    },
                    success: function (msg) {
                        wait_dialog.close();
                        if (msg.success == 1) {
                            //隐藏发送至录单员按钮
                            $("#sendToRecorderBtn").hide();
                            top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        } else {
                            top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error", SQ_showButtons: true});
                        }
                    }
                });
            });
        });

        /*发起流程*/
        $("#startFlowBtn").click(function (event) {
            //$(document).trigger('click');
            var payTypCd = $('#payTypCd').val();
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: {
                    buOrgCd: '${capPayInfoVO.buOrgCd}',
                    prjTypCd: '${capPayInfoVO.prjTypCd}',
                    paySchId: '${capPayInfoVO.paySchId}',
                    prjPrdDtlId: '${capPayInfoVO.prjPrdDtlId}',
                    prjPrdId: '${capPayInfoVO.prjPrdId}',
                    payTypCd: payTypCd
                },
                url: '<%=path%>/insurance/insTypCfgR/validate.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        var tip = "";
                        if (payTypCd == 1) {
                            tip = "是否确认发起正常放款流程？"
                        } else if (payTypCd == 2) {
                            tip = "是否确认发起提前放款流程？"
                        } else if (payTypCd == 3) {
                            tip = "是否确认发起特殊放款流程？";
                        }
                        $.ligerDialog.confirm(tip, function (flag) {
                            if (flag == false)return;
                            // 17-8-10 by YAOXIURONG 
                            opt('<%=path%>/capital/capPayInfo/payApply.do?id=' + capPayInfoId, 2);
                            //opt('<%=path%>/capital/capPayInfo/payApplyV2.do?id=' + capPayInfoId, 2);
                        });
                    } else {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error", SQ_showButtons: true,});
                    }
                }
            });
        });
    });


    function setPayerAccNoData(_loanInsCode,payerBkNmMap){
        var url = '<%=path%>/rfbase/fribaseinfo/getBankAccInfoList.do';
        var params = {insCode: _loanInsCode};
        var payerAccNoList = [];
        var payerBkNmList =[];
        $.ajax({
            type: 'get',
            dataType: 'json',
            data: params,
            url: url,
            success: function (msg) {
                if (msg.success === 1 && CollectionUtils.isNotEmpty(msg.data)) {
                    if (_loanInsCode === 'pafsbank'){
                        $("#payerAccNoDiv").show();
                        if (liger.get("payerBkNm")){
                            liger.get("payerBkNm").setDisabled(true);
                        }
                    }
                    var data = msg.data;
                    for (var i = 0; i < data.length; i++) {
                        var obj = new Object();
                        obj.key = data[i].accNum;
                        obj.value = data[i].accNum;
                        payerAccNoList.push(obj);
                        var obj1 = new Object();
                        obj1.key = data[i].banAccNm;
                        obj1.value = data[i].banAccNm;
                        payerBkNmList.push(obj1);
                        payerBkNmMap.put(data[i].accNum,data[i].banAccNm);
                    }
                    var payerAccNo = liger.get("payerAccNo");
                    payerAccNo.setData(payerAccNoList);
                    var payerBkNm = liger.get("payerBkNm");
                    payerBkNm.setData(payerBkNmList);
                }
            }
        });
    }

//初始化担保人列表
function initGuarantorList(){
	if(!prjId)return;
	guarantorGrid = $("#ligergrid_guarantor").ligerGrid({
        url: '<%=path%>/project/prjcstbscInfo/initGuarantorList.do',
        method: 'get',
        parms:{
        	prjId:prjId,
        	cstRlTyp:ProjectConstant.CST_RL_SPONSOR
        },
        columns: [
            {display: '担保人姓名', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h ='';
            		if(rowdata.cstTypCd==1){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
                    if(rowdata.cstTypCd==2){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
            		h+='<a href="javascript:toGuarantorDetail(';
                    h+=rowdata.id;
                    h+=","+rowdata.cstTypCd;
                    h+=')">'+rowdata.cstNm+'</a>';
                return h;
            	}
            },
            {display: '担保人身份证号', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.certNo)){
                        h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                        h+="'"+"reCertNo"+"','"+rowdata.certNo+"')";
                        h+='"><i class="sqBtnIco_1"></i></a>';
                        h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                        h+=rowdata.certNo;
            		}
            		return h;
            	}
            },
            {display: '联系方式', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp1)){
            				h = '' + cstNpBscInfoVO.mp1 + '';
            			}else if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp2)){
            				h = '' + cstNpBscInfoVO.mp2 + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeTel)){
            				h = '' + cstCorpBscInfoVO.officeTel + '';
            			}
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reMp1"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}
            },
            {display: '联系地址', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.homeAddr)){
            				h = '' + cstNpBscInfoVO.homeAddr + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeAddr)){
            				h = '' + cstCorpBscInfoVO.officeAddr + '';
            			}
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"rePostAddr"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}
            },
            {display: '担保人婚姻状况', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.marStsCdNm)){
            			h = ''+rowdata.cstNpBscInfoVO.marStsCdNm+'';
            		}
            		return h;
            	}
            },
            {display: '担保人配偶姓名', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.cstNpSocialRlVO)){
            			h = ''+rowdata.cstNpBscInfoVO.cstNpSocialRlVO.rlNm+'';
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reCstNm"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
            		return h;
            	},
           	},
			{display: '合同签署状态', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.conSignStsNm)){
            			h = ''+rowdata.prjCstBscInfoVO.conSignStsNm+'';
            		}
            		return h;
            	}
            },
			{display: '担保属性', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.guaraTypCdNm)){
            			h = ''+rowdata.prjCstBscInfoVO.guaraTypCdNm+'';
            		}
            		return h;
            	}
            },
            {display: '签署方式', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.cntTypCdNm) ){
            			h = ''+rowdata.prjCstBscInfoVO.cntTypCdNm+'';
            		}
            		return h;
            	}
            },
			getNpGuarColumn()
            ],
        onBeforeEdit: function (e) {},
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//获取操作列
function getNpGuarColumn(){
	var column = {
		display: '操作',
		isSort: false,
		width: 250,
		align:'left',
		render: function (rowdata, rowindex, value){
			var h="";
			if(rowdata.id && rowdata.cstNpBscInfoVO){
                if((guaraStatus==3) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:removeBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+= "'"+rowdata.prjCstBscInfoVO.guaraTypCd + "'";
                    h+=')"><i class="sqBtnIco_7"></i>删除</a>'
                }
                if((guaraStatus==3 || guaraStatus==2) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:modifyNpGuarBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                    h+=')"><i class="sqBtnIco_4"></i>修改</a>'
                }
                h+='<a class="sq-button-hasicon" href="javascript:detailNpGuarBtn(';
                h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                h+=')"><i class="sqBtnIco_2"></i>查看</a>'
                if (rowdata.prjCstBscInfoVO.cntTypCd==1 && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0) && rowdata.prjCstBscInfoVO.isPushCon==0) {
                    h+='<a class="sq-button-hasicon" href="javascript:pushCon(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+="'"+rowdata.prjCstBscInfoVO.guaraTypCd+"'";
                    h+=')"><i class="sqBtnIco_3"></i>推送合同</a>'
                }
            }
		 	return h;
		}
	}
	return column;
}
//查看担保人信息
function detailNpGuarBtn(id,mp1){
		var  url = '<%=path%>/project/prjcstbscInfo/detailNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1';//showGuarPart=1不展示部分担保人信息
		$.ligerDialog.SQopen({
            height:300,
            width: 600,
            title : '查看担保人信息',
            url: url,
            showMax: false,
            showToggle: true,
            showMin: false,
            isResize: true,
            slide: false,
        });
	}
//修改担保人信息
function modifyNpGuarBtn(id,isPushCon,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/modifyNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1'+'&&prjId='+prjId +'&&isPushCon='+isPushCon+'&&onlyConTyp='+'1';
	$.ligerDialog.SQopen({
		height:300,
		width: 600,
		title : '修改担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
//推送担保合同
function pushCon(id,guaraTypCd){
    if (!id){
        return;
    }
    var params = {};
    params.id = id;
    params.guaraTypCd = guaraTypCd;
    $.ajax({
        type: 'post',
        dataType:'json',
        data:params,
        url: '<%=path%>/project/prjcstbscInfo/pushCon.do',
        success:function(msg){
             if(msg.success == 1){
                 if(cstTypCd=ProjectConstant.CST_TYP_CD_NP){
                     liger.get("ligergrid_guarantor").reload();
                    };
             }else{
                 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
             }
        }
    });
}
//删除所选项目客户信息
function removeBtn(id,isPushCon,guaraTypCd){
	$.ligerDialog.confirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
	if(!id || id=="undefined"){
		var manager = $("#ligergrid_guarantor").ligerGetGridManager();
		manager.deleteSelectedRow();
		return;
	}
	if(flag == false)return;
    var params = {};
    params.guaraTypCd = guaraTypCd;
    params.prjId = prjId;
    params.isPushCon = isPushCon;
    params.id = id;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/removeCstAndDelCont.do',
		success:function(msg){
			 if(msg.success == 1){
				 liger.get("ligergrid_guarantor").reload();
			 }else{
				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			 }
		}
		});
	});
}
//担保人详情
function toGuarantorDetail(_cstId,_cstTypCd){
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}
//查询项目信息(查重)
function toRePrjPageList(type,value){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(StringUtils.isEmpty(_cstId) || StringUtils.isEmpty(_projectId) || StringUtils.isEmpty(_cstTypCd))return;
	Add_navTab('tab_re_prj'+'-'+type+_cstId,'查重页面','<%=path%>/project/prjbscinfo/toRePrjListPage.do?id='+_cstId+'&cstTypCd='+_cstTypCd+'&prjId='+_projectId+'&type='+type+'&value='+value);
}
  	//调资金系统发起付款
	function toSendPay(){
        var wait_dialog;
      	//像资金系统发送支付单信息
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		url: '<%=path%>/capPay/flow/toSendPayForBus.do?busPayFlag=${busPayFlag}&capPayId='+_capPayId,
    		beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 UIUtils.alertSuccess(msg.info);
    				 window.location.reload();
    			 }else{
    				 UIUtils.alertError(msg.info);
    			 }
    		}
    	});
    	
    }

    function opt(_url, _typ) {
        if (!form.valid()) {
            $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var data = form.getData();
        data['payeeList'] = JSON.stringify(getFieldsetsValues(fields, counts));
        var payerAccNo = '';
        if (liger.get("payerAccNo")){
            payerAccNo = liger.get("payerAccNo").selectedText;
        }
        var payerBkNm = '';
        if (liger.get("payerBkNm")){
            payerBkNm = liger.get("payerBkNm").selectedText;
        }
        data['payerAccNo'] = payerAccNo;
        data['payerBkNm'] = payerBkNm;
        console.log(JSON.stringify(data));
        $.ligerDialog.hide();
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: _url,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    if (_typ == 1) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        var resp = msg.data;
                        for (var i = 0; i < resp.length; i++) {
                            $("#payeeId" + resp[i].key).val(resp[i].value);
                        }
                    }
                    if (_typ == 2) {
                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success", SQ_showButtons: true});
                        //回调刷新列表
                        var callback = frameElement.W2W.callback;
                        Remove_navTab();
                        callback();
                    }
                }else if(msg.success ==2){//找到多个流程
    				//TODO 
    				console.log(msg.data);
    				var __DATA_radioList = msg.data;
					var selectedVal = '';
					var selectDialog = $.ligerDialog.SQopen({
						 width: 300,
						 height: 200,
						 title : '请选择要发起的流程',
						 allowClose: false,
						 content: '<div id="radiolist1"></div>',
						 fixButtons: true, //固定按钮到底部
						 onOk: function () {
						     console.log(selectDialog);
						     console.log(selectedVal);
						     if(StringUtils.isEmpty(selectedVal)){
						    	 $.ligerDialog.SQalert({content: "请选择要发起的流程.", SQ_type: "warning"});
						         return;
						     }else{
							    selectDialog.close();
						    	var wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting",onClose: function () {}});
	    	            		$.ajax({
	    	                		type: 'post',
	    	                		dataType:'json',
	    	                		data: data,
	    	                		url: _url+'&procDefKey='+selectedVal,
	    	                		success:function(msg){
	    	                			 wait_dialog.close();
	    	                			 if(msg.success == 1){//成功发起流程
	    	               					 /* UIUtils.alertSuccessHold1(msg.info);
	    	                				 grid.reload(); */
	    	                				 if (_typ == 1) {
	    	                                     top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
	    	                                     var resp = msg.data;
	    	                                     for (var i = 0; i < resp.length; i++) {
	    	                                         $("#payeeId" + resp[i].key).val(resp[i].value);
	    	                                     }
	    	                                 }
	    	                                 if (_typ == 2) {
	    	                                     top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success", SQ_showButtons: true});
	    	                                     //回调刷新列表
	    	                                     var callback = frameElement.W2W.callback;
	    	                                     Remove_navTab();
	    	                                     callback();
	    	                                 }
	    	                			 }else if(msg.success == 0){//错误
	    	               					 UIUtils.alertErrorHold1(msg.info);
	    	                			 }
	    	                		}
	    	            		})					    	 
						     }
						 }
					});
					$("#radiolist1").ligerRadioList({
					 data: __DATA_radioList,
					 textField: 'procNm',
					 valueField: 'procDefKey',
					 rowSize: 1,
					 onSelect: function (data)
					 {
					     console.log(data);
					     selectedVal = data.value;
					 }
					});
    			 } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error", SQ_showButtons: true});
                }
            }
        });
    }

    //查询客户详情
    function showCstDtl(_cstId) {
        Add_navTab("InsPlcCstBscInfo_" + _cstId, "客户信息", '<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id=' + _cstId, null);
    }

    //项目详情
    function toPrjDetail(_projectId) {
        if (!_projectId)return;
        Add_navTab("prjDetail" + _projectId, "项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?detailFlag=true&id=' + _projectId);
    }

    // 支付表详情
    function showPrjPrdPaySchDtl() {
        var editFlag = true;
        var prjId = '${capPayInfoVO.prjId}';
        var id = '${capPayInfoVO.paySchId}';
        var prjPrdDtlId = '${capPayInfoVO.prjPrdDtlId}';
        var prjPrdId = '${capPayInfoVO.prjPrdId}';
        Add_navTab('tab_prj_quat_prps' + id, '查看支付表', '<%=path%>/project/prjprdpayschm/toAddPage.do?prjId=' + prjId + '&&id=' + id + '&&prjPrdDtlId=' + prjPrdDtlId + '&&prjPrdId=' + prjPrdId + '&&detailFlag=' + editFlag);
    }

    function getFieldsetsValues(fields, count) {
        var fieldsetValues = [];
        for (var i = 0; i < count.length; i++) {
            var values = _getValues(count[i]);
            if (values.bkId == '') {
                continue;
            }
            fieldsetValues.push(values);
        }
        return fieldsetValues;

        function _getValues(i) {
            var values = {};
            $.each(fields, function (index, val) {
                var el = document.getElementById(val + i);
                if(el){
                    elID = el.id;
                    ligerObj = liger.get(elID);
                    value = '';
                    if (ligerObj) {
                        value = ligerObj.getValue();
                    } else {
                        value = el.value;
                    }
                    if(val==="actPayAmt"){
                        value=parseInt(value*100)
                    }else if(val==="actPayTms"){
                        value = el.value;
                    }else if(val === "realPayAmt"){
                        value=parseInt(value*100)
                    }
                    values[val] = value;
                }
            });
            return values;
        }
    }

    var _capPayId = '${id}';//付款ID
    var _proIntId = '${proIntId}';//流程实例ID
    var _taskId = '${taskId}';//任务节点ID
    var _taskDefKey = '${taskDefKey}';//任务节点KEY
    var _taskNm = '${taskNm}';//任务节点名称
    function rejOpnStart() {
        var bookTypCd = AuditConstant.AUD_LOAN_BOOK_TYP_CD;//台账类型-放款驳回台账
        var opinionTypeCd = AuditConstant.SYS_FLOW_REJ_RSN_TYP_CD_LOAN;//驳回意见类型-放款驳回
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '驳回意见',
            url: '<%=path%>/audit/audRejectOpinion/toAddPage.do?capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&taskId=' + _taskId + '&taskDefKey=' + _taskDefKey + '&opinionTypeCd=' + opinionTypeCd + '&bookTypCd=' + bookTypCd + '&taskNm=' + _taskNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    var _procNm = '${procNm}';//流程定义名称

    //放款合同通过意见
    function contractOpnStart() {
        var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_CONTRACT;
        var url = null;
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '放款合同通过意见',
            url: url = '<%=path%>/audit/audPayPassOpinion/toModifyPage.do?busAudit=1&capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&payTypCd=2&opnTypCd=' + _opnTypCd + '&procNm=' + _procNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.preview) Dialog.preview();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }
    //放款抵押通过意见
    function mortGageOpnStart() {
        var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_MORTGAGE;
        top.$.ligerDialog.open({
            width: 1000,
            height: 400,
            title: '放款抵押通过意见',
            url: '<%=path%>/audit/audPayPassOpinion/toModifyPage.do?capPayId=' + _capPayId + '&proIntId=' + _proIntId + '&opnTypCd=' + _opnTypCd + '&procNm=' + _procNm,
            buttons: [{
                text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.onOk) Dialog.onOk();
                }
            }, {
                text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                onclick: function (item, Dialog) {
                    if (Dialog.preview) Dialog.preview();
                }
            }, {
                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                onclick: function (item, Dialog) {
                    if (Dialog.onCancel) Dialog.onCancel();
                }
            }
            ]
        });
    }

    // jiangzg 2017-9-21 11:00:24 add 查看上牌信息
    function detailBtn(id,dtlId){
        var detailFlag = true;
        Add_navTab('tab_prj_prd_veh_info_detail'+id,'上牌详情','<%=path%>/project/prjprdlicinfo/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+dtlId);
    }
 //信审节点验证上牌信息   
    function detailBtn1(id,dtlId){
        var callback = function (Yz) {
        	$("#Sp1").hide();
    	if(Yz){
    			$("#Sp2").show();
    			$("#Sp3").hide();
    			$("#Sp4").hide();
    			$("#Sp5").hide();
    			
    	}else{
			$("#Sp3").show();
			$("#Sp2").hide();
			$("#Sp4").hide();
			$("#Sp5").hide();
    	}
        };
    		var detailFlag = true;
    		var checkSp = 0;
            Add_navTab('tab_prj_prd_veh_info_detail'+id,'上牌详情','<%=path%>/project/prjprdlicinfo/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+dtlId+'&&checkSp='+checkSp,callback);
    }
    function detailBtn2(id,dtlId){
        var callback = function (Yz) {
        	$("#Sp1").hide();
    	if(Yz){
    		
    			$("#Sp2").show();
    			$("#Sp3").hide();
    			$("#Sp4").hide();
    			$("#Sp5").hide();
    	}else{
			$("#Sp3").show();
			$("#Sp2").hide();
			$("#Sp4").hide();
			$("#Sp5").hide();
    	}
        };
    		var detailFlag = true;
    		var checkSp = 0;
            Add_navTab('tab_prj_prd_veh_info_detail'+id,'上牌详情','<%=path%>/project/prjprdlicinfo/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+dtlId+'&&checkSp='+checkSp,callback);
    }
    function detailBtn3(id,dtlId){
        var callback = function (Yz) {
        	$("#Sp1").hide();
        //	alert(1);
    	if(Yz){
    			$("#Sp2").show();
    			$("#Sp3").hide();
    			$("#Sp4").hide();
    			$("#Sp5").hide();
    	}else{
			$("#Sp3").show();
			$("#Sp2").hide();
			$("#Sp4").hide();
			$("#Sp5").hide();
    	}
        };
    		var detailFlag = true;
    		var checkSp = 0;
            Add_navTab('tab_prj_prd_veh_info_detail'+id,'上牌详情','<%=path%>/project/prjprdlicinfo/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+dtlId+'&&checkSp='+checkSp,callback);
    }
  //信审节点验证抵押信息   
 function DYBtn1 (id,id){
	 var callback = function (Dy,mtgWayCd) {
     	$("#Dy1").hide();
 	if(Dy){
        if (mtgWayCd == '2'){
            $("#Dy2").hide();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").show();
        } else {
            $("#Dy2").show();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
        }
 	}else{
			$("#Dy3").show();
			$("#Dy2").hide();
			$("#Dy4").hide();
			$("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();

 	}
     };
     var detailFlag = true;
     var checkDy = 0;
     Add_navTab('tab_prj_prd_veh_mtg_detail'+id,'抵押详情','<%=path%>/project/prjprdmtg/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+id+'&&checkDy='+checkDy,callback);
 }
 function DYBtn2 (id,id){
	 var callback = function (Dy,mtgWayCd) {
     	$("#Dy1").hide();
 	if(Dy){
 	    if (mtgWayCd == '2'){
            $("#Dy2").hide();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").show();
        } else {
            $("#Dy2").show();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
        }
 	}else{
			$("#Dy3").show();
			$("#Dy2").hide();
			$("#Dy4").hide();
			$("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
 	}
     };
     var detailFlag = true;
     var checkDy = 0;
     Add_navTab('tab_prj_prd_veh_mtg_detail'+id,'抵押详情','<%=path%>/project/prjprdmtg/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+id+'&&checkDy='+checkDy,callback);
 }
 function DYBtn3 (id,id){
	 var callback = function (Dy,mtgWayCd) {
     	$("#Dy1").hide();
 	if(Dy){
        if (mtgWayCd == '2'){
            $("#Dy2").hide();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").show();
        } else {
            $("#Dy2").show();
            $("#Dy3").hide();
            $("#Dy4").hide();
            $("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
        }
 	}else{
			$("#Dy3").show();
			$("#Dy2").hide();
			$("#Dy4").hide();
			$("#Dy5").hide();
            $("#Dy6").hide();
            $("#Dy7").hide();
 	}
     };
     var detailFlag = true;
     var checkDy = 0;
     Add_navTab('tab_prj_prd_veh_mtg_detail'+id,'抵押详情','<%=path%>/project/prjprdmtg/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+id+'&&checkDy='+checkDy,callback);
 }
    function DYBtn4 (id,id){
        var callback = function (Dy,mtgWayCd) {
            $("#Dy1").hide();
            if(Dy){
                if (mtgWayCd == '2'){
                    $("#Dy2").hide();
                    $("#Dy3").hide();
                    $("#Dy4").hide();
                    $("#Dy5").hide();
                    $("#Dy6").hide();
                    $("#Dy7").show();
                } else {
                    $("#Dy2").show();
                    $("#Dy3").hide();
                    $("#Dy4").hide();
                    $("#Dy5").hide();
                    $("#Dy6").hide();
                    $("#Dy7").hide();
                }
            }else{
                $("#Dy3").show();
                $("#Dy2").hide();
                $("#Dy4").hide();
                $("#Dy5").hide();
                $("#Dy6").hide();
                $("#Dy7").hide();
            }
        };
        var detailFlag = true;
        var checkDy = 0;
        Add_navTab('tab_prj_prd_veh_mtg_detail'+id,'抵押详情','<%=path%>/project/prjprdmtg/toAddPage.do?detailFlag='+detailFlag+'&&id='+id+'&&dtlId='+id+'&&checkDy='+checkDy,callback);
    }
 /* 新增 */
 $("#addBtn").click(function (event) {
     $.ligerDialog.SQopen({
         width: 500,
         height: 300,
         title: '补充专车客车信息',
         url: '<%=path%>/capital/capPayInfo/toMwssagelPage.do?id=' + _id
     	});
 	});
 //保存抵押权人名称
 function addpledgeeAuthNm(){
 	var pledgeeAuthNm = $('#pledgee Select option:selected') .val();//选中的值
 	 var prjPrdDtlId = "${prjPrdDtlId}";//项目产品明细id
 	var wait_dialog;
 		$.ajax({
 			type: 'post',
			dataType:'json',
			data:{pledgeeAuthNm:pledgeeAuthNm,id:prjPrdDtlId},
			url:'<%=path%>/project/prjprdmtg/addpledgeeAuthNm.do',
			beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
		    success:function(msg){
				 wait_dialog.close();
				 if(msg.success == 1){
					 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				 }else{
					 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
				 }
			}
 	})
 	
 }

    //保存三方业务处理意见
    function saveOrgBizOpnCd(){
        var orgBizOpnCd = $("#orgBizOpnCd").val();
        if(!orgBizOpnCd || orgBizOpnCd==" "){
            top.$.ligerDialog.SQalert({content: "三方业务处理意见不能为空.", SQ_type: "warning"});
            return;
        }
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType:'json',
            data:{
                prjId:'${capPayInfoVO.prjId }',
                orgBizOpnCd:orgBizOpnCd
            },
            url: '<%=path%>/capPay/flow/modifyOrgBizOpnCd.do',
            beforeSend: function(){
                wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
            },
            success:function(msg){
                wait_dialog.close();
                if(msg.success == 1){
                    top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
                }else{
                    top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
                }
            }
        });
    }


function visual(){
    // SEC-295 页面跳转调整
    Add_navTab('tab_spl_grp_memb_dev_amt_rankvisual' + ${prjId},'狮桥关联图谱','<%=path%>/knowledgeGraph/init/initGraphVisualPage.do?prjId=${prjId}&c_no=${certNo}&usrId=${currentUsrId}');
}

//请求信审整体资料数据，获取"信审遗留问题"字段值 (参数:项目ID)-JL-20190819
var audCreditInfoId = "";
function initAudRemainPro(){
	var mdf_AudRemainPro = "${mdf_AudRemainPro }";
	if(mdf_AudRemainPro != "1"){
		$("#audRemainPro").setDisabled_ligerTextarea(true); //禁用"信审遗留问题"-JL
	}
	var _projectId = "${prjId}";
	if(!_projectId){
		return;
	}
   	var _url = '<%=path%>/audit/audCreditInfo/getAudCreditInfoByPrjId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				$("#audRemainPro").val(msg.data.audRemainPro); //设置数据显示
				audCreditInfoId = msg.data.id; //信审整体资料主键
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
//保存"信审遗留问题"到"信审整体资料表"-JL-20190819
function saveAudRemainPro(){
	var audRemainPro = $("#audRemainPro").val();
    if (audRemainPro && audRemainPro.length > 250) {
        top.$.ligerDialog.SQalert({content: "信审遗留问题不能大于250个字符", SQ_type: "warning"});
        return false;
    }
	if(!audCreditInfoId){
		top.$.ligerDialog.SQalert({content:"信审整体资料主键为空异常！", SQ_type: "warning"});
		return;
	}
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:{
			id:audCreditInfoId,
			audRemainPro:audRemainPro
		},
		url: '<%=path%>/audit/audCreditInfo/modifyAudCreditInfo.do',
		beforeSend: function(){
			wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		},
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
			 }else{
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			 }
		}
	});
}

</script>
</body>
</html>
